package Ex01;

import java.util.Scanner;

public class Stage02 {
    public  static  void  main(String[] args) {
        Scanner input =  new  Scanner (System.in);
        System.out.println( "****************************************" );
        System.out.println( "请选择购买的商品编号:" );
        System.out.println( "1.T恤\t2.网球拍\t3.网球拍" );
        System.out.println( "****************************************\n\n" );
        String answer= "y" ;
        String name= "" ;
        double  money= 0 ;
        while  (answer.equals( "y" )){
            System.out.print( "请输入商品编号:" );
            int  No= input.nextInt();
            System.out.print( "请输入购买数量:" );
            int  number=input.nextInt();
            switch  (No) {
                case  1 :
                    name= "T恤" ;
                    money+= 245 *number;
                    break ;
                case  2 :
                    name= "网球鞋" ;
                    money+= 570 *number;
                    break ;
                case  3 :
                    name= "网球拍" ;
                    money+= 320 *number;
                    break ;
                default :
                    break ;
            }
            System.out.println(name+ "\t数量" +number+ "\t合计" +money);
            System.out.print( "是否继续(y / n):" );
            answer=input.next();
        }
        System.out.println( "折扣:0.8" );
        System.out.println( "应付金额:" +money* 0.8 );
        System.out.print( "应付金额:" );
        int pay=input.nextInt();
        System.out.println( "找钱:" +(pay-money* 0.8 ));

    }
}
